﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CreateEnemy : MonoBehaviour {
	public GameObject smallEnemy;
	public GameObject BigEnemy;
	float time1=0;
	float time2=0;
	// Use this for initialization
	void Start () {
		
	}

	// Update is called once per frame
	void Update ()
	{
		time1 += Time.deltaTime;
		if (time1 >= 1f) {
			time1 = 0;
			Instantiate (smallEnemy, new Vector3 (Random.Range (-2, 2), 8F, 0.3f), Quaternion.identity);
		}
		time2 += Time.deltaTime;
		if (time2 >= 5f) {
			time2 = 0;
			Instantiate (BigEnemy, new Vector3 (Random.Range (-2, 2), 8F, 0.3f), Quaternion.identity);
		}
	}
}
